<template>
	<view @tap="jumpToProfile" class="flex justify-center align-center bg-white padding radius shadow" style="flex-direction: column;width: 100%;">
		<image class="radius" :src="userInfo.avatar" style="width: 88upx;height: 88upx;"></image>
		<view style="height: 1px;"></view>
		<text class="text-df text-cut" style="max-width: 98%;">{{userInfo.nickname}}</text>
		<view style="height: 20upx;"></view>
		<button v-if="userInfo.is_attention==0" @tap.stop="attentionAction" class="cu-btn bg-orange round sm"><text class="cuIcon-add"><text>关注</text></text></button>
		<button v-else @tap.stop="attentionAction" class="cu-btn bg-grey round sm">已关注</button>
	</view>
</template>

<script>
	export default {
		name:"RecommendUserItem",
		data() {
			return {
				
			};
		},
		props: {
			userInfo:{
				type:Object,
				default:{}
			}
		},
		methods: {
			jumpToProfile() 
			{
				uni.navigateTo({
					url:'/pages/profile/profile?userId='+this.userInfo.user_id
				})
			},
			attentionAction() {
				this.$emit('attention')
			}
		},
	}
</script>

<style lang="scss">

</style>
